Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at scan, implemented linear and ring algorithms #1154

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

avincigu
Copy link
Collaborator

No description provided.

Copy link
Member

@davidozog davidozog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks @avincigu!

I noticed an issue with "in-place" scan (the specification example uses the same source and dest buffer). Do you have any other testing in place?

The C11 variants can probably added as well - something like this:

diff --git a/mpp/shmemx.h4 b/mpp/shmemx.h4
index 92b38519..f82729e0 100644
--- a/mpp/shmemx.h4
+++ b/mpp/shmemx.h4
@@ -119,6 +119,19 @@ SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_IBGET', `, \') \
         uint64_t*: shmemx_signal_add \
     )(__VA_ARGS__)

+define(`SHMEM_C11_GEN_EXSCAN', `        $2*: shmemx_$1_sum_exscan')dnl
+#define shmemx_sum_exscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_EXSCAN', `, \') \
+    )(__VA_ARGS__)
+
+define(`SHMEM_C11_GEN_INSCAN', `        $2*: shmemx_$1_sum_inscan')dnl
+#define shmemx_sum_inscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_INSCAN', `, \') \
+    )(__VA_ARGS__)

The code style is a bit different from typical SOS, at least in collectives.c. We gravitate towards the Google style guide:
https://google.github.io/styleguide/cppguide.html

Let's chat offline tomorrow, thanks!

src/collectives.c Outdated Show resolved Hide resolved
src/collectives.c Outdated Show resolved Hide resolved
@davidozog
Copy link
Member

davidozog commented Oct 15, 2024

The Portals4 testing row looks like a real issue to me, seemingly with the pshmem symbols.
The UCX rows look like a known issue #1148

@wrrobin
Copy link
Collaborator

wrrobin commented Oct 16, 2024

This looks great, thanks @avincigu!

I noticed an issue with "in-place" scan (the specification example uses the same source and dest buffer). Do you have any other testing in place?

The C11 variants can probably added as well - something like this:

diff --git a/mpp/shmemx.h4 b/mpp/shmemx.h4
index 92b38519..f82729e0 100644
--- a/mpp/shmemx.h4
+++ b/mpp/shmemx.h4
@@ -119,6 +119,19 @@ SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_IBGET', `, \') \
         uint64_t*: shmemx_signal_add \
     )(__VA_ARGS__)

+define(`SHMEM_C11_GEN_EXSCAN', `        $2*: shmemx_$1_sum_exscan')dnl
+#define shmemx_sum_exscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_EXSCAN', `, \') \
+    )(__VA_ARGS__)
+
+define(`SHMEM_C11_GEN_INSCAN', `        $2*: shmemx_$1_sum_inscan')dnl
+#define shmemx_sum_inscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_INSCAN', `, \') \
+    )(__VA_ARGS__)

The code style is a bit different from typical SOS, at least in collectives.c. We gravitate towards the Google style guide: https://google.github.io/styleguide/cppguide.html

Let's chat offline tomorrow, thanks!

Looking at the PR, I realize why @davidozog commented on code style. I did not see any issue when we were looking at the code @avincigu. Perhaps, it is the editor you were using.

@avincigu
Copy link
Collaborator Author

This looks great, thanks @avincigu!

I noticed an issue with "in-place" scan (the specification example uses the same source and dest buffer). Do you have any other testing in place?

The C11 variants can probably added as well - something like this:

diff --git a/mpp/shmemx.h4 b/mpp/shmemx.h4
index 92b38519..f82729e0 100644
--- a/mpp/shmemx.h4
+++ b/mpp/shmemx.h4
@@ -119,6 +119,19 @@ SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_IBGET', `, \') \
         uint64_t*: shmemx_signal_add \
     )(__VA_ARGS__)

+define(`SHMEM_C11_GEN_EXSCAN', `        $2*: shmemx_$1_sum_exscan')dnl
+#define shmemx_sum_exscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_EXSCAN', `, \') \
+    )(__VA_ARGS__)
+
+define(`SHMEM_C11_GEN_INSCAN', `        $2*: shmemx_$1_sum_inscan')dnl
+#define shmemx_sum_inscan(...) \
+    _Generic(SHMEM_C11_TYPE_EVAL_PTR(SHMEM_C11_ARG1(__VA_ARGS__)), \
+SHMEM_BIND_C11_RMA(`SHMEM_C11_GEN_INSCAN', `, \') \
+    )(__VA_ARGS__)

The code style is a bit different from typical SOS, at least in collectives.c. We gravitate towards the Google style guide: https://google.github.io/styleguide/cppguide.html

Let's chat offline tomorrow, thanks!

Thanks for the comments Dave! I made the changes you suggested. It seems like my editor was adding extra spaces whenever I hit tab. I have fixed it now, please let me know if you see any style issues still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants